
from flask import Flask
from project import db  # 确保从正确的模块导入db实例

# 初始化Flask应用
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:12345678@localhost:3306/sct'  # 配置数据库连接
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False  # 关闭对模型修改的跟踪

# 将db实例与app绑定
db.init_app(app)

# 导入并初始化路由
from project.routes import configure_routes

configure_routes(app)

if __name__ == '__main__':
    app.run()
